home *** CD-ROM | disk | FTP | other *** search
/ PC Action 1997 January / PCA0197.ISO / demos / ambe / roxy / roxy.dxr / 00002_custom domain rules.ls < prev    next >
Encoding:
Text File  |  1996-10-28  |  15.8 KB  |  452 lines

  1. on disablePeekAlert
  2.   global gPeekAlertEnabled
  3.   set gPeekAlertEnabled to 0
  4. end
  5.  
  6. on enablePeekAlert
  7.   global gPeekAlertEnabled
  8.   set gPeekAlertEnabled to 1
  9. end
  10.  
  11. on clearTheStage
  12.   global oPuppeteer
  13.   repeat with i = 1 to 43
  14.     puppetSprite(i, 0)
  15.   end repeat
  16.   updateStage()
  17. end
  18.  
  19. on setPKScanStatus suggestion
  20.   global oStoryteller, oPuppeteer, gScanFinish
  21.   set validList to [#Offline, #CantAttach, #Online, #NoResidue, #Wait5min, #Wait4min, #Wait3min, #Wait2min, #Wait1min, #ReadyForPlayback, #Interrupted, #Preamble]
  22.   if not getPos(validList, suggestion) then
  23.     alert("Can't set #PKscanStatus to " & suggestion)
  24.     exit
  25.   end if
  26.   set currentStatus to getState(oStoryteller, #PKscanStatus)
  27.   if suggestion = #Online then
  28.     if getPos([#Wait1min, #Wait2min, #Wait3min, #Wait4min, #Wait5min], currentStatus) then
  29.       set gScanFinish to 0
  30.       set suggestion to #Interrupted
  31.     end if
  32.     if currentStatus = #ReadyForPlayback then
  33.       set suggestion to #ReadyForPlayback
  34.     end if
  35.   end if
  36.   if suggestion = #Offline then
  37.     set gScanFinish to 0
  38.   end if
  39.   if currentStatus = #ReadyForPlayback then
  40.     if suggestion <> #ReadyForPlayback then
  41.       setState(oStoryteller, #PeekDisplay, #None)
  42.     end if
  43.     if getPos([#Wait5min, #Wait4min, #Wait3min, #Wait2min, #Wait1min], suggestion) then
  44.       setState(oStoryteller, #PeekDisplay, #goodScan5min)
  45.     else
  46.     end if
  47.   end if
  48.   setProp(the lsStateData of oStoryteller, #PKscanStatus, [suggestion])
  49.   if (suggestion = #Interrupted) and (getState(oStoryteller, #playerHasPeekUnit) = #carrying) then
  50.     setState(oStoryteller, #PeekDisplay, #interruptedScan)
  51.     peekAlert()
  52.   end if
  53.   if the castNum of sprite 41 = getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 4) then
  54.     set the castNum of sprite 40 to getProp(getProp(the lsMultiframes of oPuppeteer, #peekText), value("#scan" & suggestion))
  55.   end if
  56. end
  57.  
  58. on setPKbarStatus suggestion
  59.   global oStoryteller, oPuppeteer
  60.   set validList to [#Offline, #Online, #noActivity, #ActivityDetected]
  61.   if not getPos(validList, suggestion) then
  62.     alert("Can't set #PKbarStatus to " & suggestion)
  63.     exit
  64.   end if
  65.   setProp(the lsStateData of oStoryteller, #PKbarStatus, [suggestion])
  66.   if the castNum of sprite 42 = getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 4) then
  67.     set the castNum of sprite 40 to getProp(getProp(the lsMultiframes of oPuppeteer, #peekText), value("#bar" & suggestion))
  68.   end if
  69. end
  70.  
  71. on setPKamberStatus suggestion
  72.   global oStoryteller, oPuppeteer
  73.   set validList to [#Incomplete, #Online, #WaveButIncomplete, #WaveActivated, #ModulatingEEG, #OneMoment, #surfsUp]
  74.   if not getPos(validList, suggestion) then
  75.     alert("Can't set #PKamberStatus to " & suggestion)
  76.     exit
  77.   end if
  78.   if suggestion = #Online then
  79.     if getState(oStoryteller, #psionicWavesPresent) then
  80.       set suggestion to #WaveActivated
  81.     else
  82.       set suggestion to #Online
  83.     end if
  84.   end if
  85.   if suggestion = #WaveActivated then
  86.     if getState(oStoryteller, #oscillatorInPlace) then
  87.       set suggestion to #WaveActivated
  88.     else
  89.       set suggestion to #WaveButIncomplete
  90.     end if
  91.   end if
  92.   setProp(the lsStateData of oStoryteller, #PKamberStatus, [suggestion])
  93.   if the castNum of sprite 43 = getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 4) then
  94.     set the castNum of sprite 40 to getProp(getProp(the lsMultiframes of oPuppeteer, #peekText), value("#amber" & suggestion))
  95.   end if
  96. end
  97.  
  98. on usePeekUnit
  99.   global oStoryteller, oPuppeteer, gPeekPlayList, gScanFinish, gOriginPoint, gCPU
  100.   setState(oStoryteller, #playerHasPeekUnit, #inUse)
  101.   killVideo()
  102.   updateStage()
  103.   idle()
  104.   cursorOff()
  105.   set peekBody to 38
  106.   set peekAntenna to 46
  107.   set peekRollUp to 44
  108.   set peekText to 40
  109.   set pkScanIcon to 41
  110.   set pkBarIcon to 42
  111.   set pkAmberIcon to 43
  112.   set buttonCoords to point(247, 270) + gOriginPoint
  113.   set textList to getProp(the lsMultiframes of oPuppeteer, #peekText)
  114.   puppetSprite(peekBody, 1)
  115.   set the stretch of sprite peekBody to 0
  116.   set the ink of sprite peekBody to 8
  117.   set the castNum of sprite peekBody to getProp(the lsForegroundData of oPuppeteer, #PeekDown)
  118.   set the loc of sprite peekBody to point(320, 200) + gOriginPoint
  119.   puppetSprite(peekAntenna, 1)
  120.   set the stretch of sprite peekAntenna to 0
  121.   set the ink of sprite peekAntenna to 36
  122.   set the castNum of sprite peekAntenna to getProp(the lsForegroundData of oPuppeteer, #peekAntenna)
  123.   set the loc of sprite peekAntenna to point(320, 200) + gOriginPoint
  124.   set peekAnim to getProp(the lsForegroundData of oPuppeteer, #PeekUpAnim)
  125.   set peekVideo to getProp(the lsForegroundData of oPuppeteer, #PkVideoNormal)
  126.   puppetSprite(peekRollUp, 1)
  127.   set the movieRate of sprite peekRollUp to 0
  128.   set the movieTime of sprite peekRollUp to 0
  129.   set slideVolume to the volume of sprite peekRollUp
  130.   set the visible of sprite peekRollUp to 0
  131.   set the castNum of sprite peekRollUp to peekAnim
  132.   setTransition(oPuppeteer, #fadeIn)
  133.   set the inventoryStatus of oPuppeteer to #cool
  134.   updateDisplay(oPuppeteer)
  135.   if gCPU = #PC then
  136.     suspendSounds(#fadeOut)
  137.   end if
  138.   set the loc of sprite peekRollUp to point(317, 189) + gOriginPoint
  139.   set the visible of sprite peekRollUp to 1
  140.   set the movieRate of sprite peekRollUp to 0
  141.   set the movieTime of sprite peekRollUp to 0
  142.   set the volume of sprite peekRollUp to slideVolume
  143.   set the movieRate of sprite peekRollUp to 1
  144.   repeat while the movieTime of sprite peekRollUp < the duration of cast peekAnim
  145.     updateStage()
  146.   end repeat
  147.   set the castNum of sprite peekBody to getProp(the lsForegroundData of oPuppeteer, #PeekUp)
  148.   set camSprite to peekRollUp
  149.   set the loc of sprite camSprite to point(317, 132) + gOriginPoint
  150.   set the castNum of sprite camSprite to getProp(peekVideo, #PkNone)
  151.   puppetSprite(peekText, 1)
  152.   set the stretch of sprite peekText to 0
  153.   set the castNum of sprite peekText to getProp(textList, #None)
  154.   set the loc of sprite peekText to point(317, 226) + gOriginPoint
  155.   puppetSprite(pkScanIcon, 1)
  156.   set the stretch of sprite pkScanIcon to 0
  157.   set the loc of sprite pkScanIcon to buttonCoords
  158.   set currentStatus to getState(oStoryteller, #PKscanStatus)
  159.   if (currentStatus <> #Offline) and (currentStatus <> #CantAttach) then
  160.     set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 3)
  161.   else
  162.     set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 2)
  163.   end if
  164.   puppetSprite(pkBarIcon, 1)
  165.   set the stretch of sprite pkBarIcon to 0
  166.   set the loc of sprite pkBarIcon to buttonCoords
  167.   if getState(oStoryteller, #BarOnline) = 1 then
  168.     set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 3)
  169.     buildDefaultPlaylist()
  170.   else
  171.     set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 2)
  172.   end if
  173.   puppetSprite(pkAmberIcon, 1)
  174.   set the stretch of sprite pkAmberIcon to 0
  175.   set the loc of sprite pkAmberIcon to buttonCoords
  176.   if getState(oStoryteller, #AMBERisOnline) = 1 then
  177.     set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 3)
  178.   else
  179.     set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 2)
  180.   end if
  181.   set hotStuff to getState(oStoryteller, #PeekDisplay)
  182.   setState(oStoryteller, #PeekDisplay, #None)
  183.   if hotStuff = #barStatus then
  184.     if getState(oStoryteller, #BarOnline) then
  185.       mouseDown(script "bar icon --")
  186.     else
  187.       mouseDown(script "scan icon --")
  188.     end if
  189.   end if
  190.   if hotStuff = #scanStatus then
  191.     mouseDown(script "scan icon --")
  192.   end if
  193.   if hotStuff = #amberStatus then
  194.     mouseDown(script "amber icon --")
  195.   end if
  196.   if hotStuff = #psionicFragment then
  197.     hideCursor()
  198.     resetPeeKdisplay()
  199.     set peekVideo to getProp(the lsForegroundData of oPuppeteer, #PkVideoNormal)
  200.     set the castNum of sprite camSprite to getProp(peekVideo, #PkFragment)
  201.     set the movieTime of sprite camSprite to 0
  202.     pushVideo()
  203.     wait(#videoStop)
  204.     if getState(oStoryteller, #houseLightsAreOn) = 1 then
  205.       set the castNum of sprite peekText to getProp(textList, #fragmentCollected)
  206.     else
  207.       set the castNum of sprite peekText to getProp(textList, #psionicFragment)
  208.     end if
  209.     updateStage()
  210.   end if
  211.   if hotStuff = #ghostKnife then
  212.     hideCursor()
  213.     set gPeekPlayList to [#PkFadeIn, #PkKitchenGhost, #PkFadeOut]
  214.     setState(oStoryteller, #PKbarStatus, #ActivityDetected)
  215.     trimState(#cameraFeedbackRemaining, #ghostKnife)
  216.     mouseDown(script "bar icon --")
  217.   end if
  218.   if hotStuff = #ghostlyKey then
  219.     hideCursor()
  220.     set gPeekPlayList to [#PkFadeIn, #PkBedroomGhost, #PkFadeOut]
  221.     setState(oStoryteller, #PKbarStatus, #ActivityDetected)
  222.     trimState(#cameraFeedbackRemaining, #ghostlyKey)
  223.     mouseDown(script "bar icon --")
  224.   end if
  225.   if hotStuff = #crazyLR then
  226.     hideCursor()
  227.     set gPeekPlayList to [#PkFadeIn, #PkCrazyLR, #PkFadeOut]
  228.     setState(oStoryteller, #PKbarStatus, #ActivityDetected)
  229.     trimState(#cameraFeedbackRemaining, #crazyLR)
  230.     mouseDown(script "bar icon --")
  231.   end if
  232.   if hotStuff = #crazyDR then
  233.     hideCursor()
  234.     set gPeekPlayList to [#PkFadeIn, #PkCrazyDR, #PkFadeOut]
  235.     setState(oStoryteller, #PKbarStatus, #ActivityDetected)
  236.     trimState(#cameraFeedbackRemaining, #crazyDR)
  237.     mouseDown(script "bar icon --")
  238.   end if
  239.   if hotStuff = #KdKnob then
  240.     hideCursor()
  241.     set gPeekPlayList to [#PkFadeIn, #PkKdKnob, #PkFadeOut]
  242.     setState(oStoryteller, #PKbarStatus, #ActivityDetected)
  243.     trimState(#cameraFeedbackRemaining, #KdKnob)
  244.     mouseDown(script "bar icon --")
  245.   end if
  246.   if hotStuff = #bloodBath then
  247.     hideCursor()
  248.     set gPeekPlayList to [#PkFadeIn, #PkBloodBath, #PkFadeOut]
  249.     setState(oStoryteller, #PKbarStatus, #ActivityDetected)
  250.     trimState(#cameraFeedbackRemaining, #bloodBath)
  251.     mouseDown(script "bar icon --")
  252.   end if
  253.   if hotStuff = #BARstartup then
  254.     set gPeekPlayList to [#PkNone]
  255.     setState(oStoryteller, #PKbarStatus, #Online)
  256.     mouseDown(script "bar icon --")
  257.     buildDefaultPlaylist()
  258.     wait(90)
  259.     setState(oStoryteller, #PKbarStatus, #noActivity)
  260.     idle()
  261.     mouseDown(script "bar icon --")
  262.   end if
  263.   if hotStuff = #amberStartup then
  264.     cursorOff()
  265.     put "<i>  UsePeekUnit(): do that crazy amber-startup stuff..."
  266.     setState(oStoryteller, #PKamberStatus, #ModulatingEEG)
  267.     mouseDown(script "amber icon --")
  268.     updateStage()
  269.     wait(240)
  270.     set the castNum of sprite peekText to getProp(textList, #None)
  271.     updateStage()
  272.     wait(20)
  273.     setState(oStoryteller, #PKamberStatus, #OneMoment)
  274.     updateStage()
  275.     wait(200)
  276.     set the castNum of sprite peekText to getProp(textList, #None)
  277.     updateStage()
  278.     wait(20)
  279.     setState(oStoryteller, #PKamberStatus, #surfsUp)
  280.     updateStage()
  281.     wait(50)
  282.     set the castNum of sprite peekText to getProp(textList, #None)
  283.     updateStage()
  284.     wait(20)
  285.     setState(oStoryteller, #PKamberStatus, #surfsUp)
  286.     updateStage()
  287.     wait(50)
  288.     set the castNum of sprite peekText to getProp(textList, #None)
  289.     updateStage()
  290.     wait(20)
  291.     setState(oStoryteller, #PKamberStatus, #surfsUp)
  292.     updateStage()
  293.   end if
  294.   if hotStuff = #irregularSurface then
  295.     hideCursor()
  296.     setState(oStoryteller, #PKscanStatus, #CantAttach)
  297.     mouseDown(script "scan icon --")
  298.     updateStage()
  299.     wait(120)
  300.     setState(oStoryteller, #PKscanStatus, #Offline)
  301.     mouseDown(script "scan icon --")
  302.   end if
  303.   if hotStuff = #badScan then
  304.     hideCursor()
  305.     if getState(oStoryteller, #DoorWithScanUnit) = #None then
  306.       set currentState to #Offline
  307.     else
  308.       set currentState to #Online
  309.     end if
  310.     setState(oStoryteller, #PKscanStatus, #NoResidue)
  311.     mouseDown(script "scan icon --")
  312.     updateStage()
  313.     wait(170)
  314.     setState(oStoryteller, #PKscanStatus, currentState)
  315.   end if
  316.   if hotStuff = #interruptedScan then
  317.     hideCursor()
  318.     if getState(oStoryteller, #DoorWithScanUnit) = #None then
  319.       set currentState to #Offline
  320.     else
  321.       set currentState to #Online
  322.     end if
  323.     setState(oStoryteller, #PKscanStatus, #Interrupted)
  324.     mouseDown(script "scan icon --")
  325.     updateStage()
  326.     wait(110)
  327.     setState(oStoryteller, #PKscanStatus, currentState)
  328.   end if
  329.   if hotStuff = #goodScan1min then
  330.     hideCursor()
  331.     set finishTime to gScanFinish
  332.     setState(oStoryteller, #PKscanStatus, #Preamble)
  333.     mouseDown(script "scan icon --")
  334.     updateStage()
  335.     wait(70)
  336.     idle()
  337.     setState(oStoryteller, #PKscanStatus, #Wait1min)
  338.     set gScanFinish to finishTime
  339.     mouseDown(script "scan icon --")
  340.   end if
  341.   if hotStuff = #goodScan2min then
  342.     hideCursor()
  343.     set finishTime to gScanFinish
  344.     setState(oStoryteller, #PKscanStatus, #Preamble)
  345.     mouseDown(script "scan icon --")
  346.     updateStage()
  347.     wait(70)
  348.     idle()
  349.     setState(oStoryteller, #PKscanStatus, #Wait2min)
  350.     set gScanFinish to finishTime
  351.     mouseDown(script "scan icon --")
  352.   end if
  353.   if hotStuff = #goodScan3min then
  354.     hideCursor()
  355.     set finishTime to gScanFinish
  356.     setState(oStoryteller, #PKscanStatus, #Preamble)
  357.     mouseDown(script "scan icon --")
  358.     updateStage()
  359.     wait(70)
  360.     idle()
  361.     setState(oStoryteller, #PKscanStatus, #Wait3min)
  362.     set gScanFinish to finishTime
  363.     mouseDown(script "scan icon --")
  364.   end if
  365.   if hotStuff = #goodScan4min then
  366.     hideCursor()
  367.     set finishTime to gScanFinish
  368.     setState(oStoryteller, #PKscanStatus, #Preamble)
  369.     mouseDown(script "scan icon --")
  370.     updateStage()
  371.     wait(70)
  372.     idle()
  373.     setState(oStoryteller, #PKscanStatus, #Wait4min)
  374.     set gScanFinish to finishTime
  375.     mouseDown(script "scan icon --")
  376.   end if
  377.   if hotStuff = #goodScan5min then
  378.     hideCursor()
  379.     set finishTime to gScanFinish
  380.     setState(oStoryteller, #PKscanStatus, #Preamble)
  381.     mouseDown(script "scan icon --")
  382.     updateStage()
  383.     wait(70)
  384.     idle()
  385.     setState(oStoryteller, #PKscanStatus, #Wait5min)
  386.     set gScanFinish to finishTime
  387.     mouseDown(script "scan icon --")
  388.   end if
  389. end
  390.  
  391. on hideCursor
  392.   global thisCursor, lastCursor
  393.   set thisCursor to #noCursor
  394.   set lastCursor to thisCursor
  395.   cursorDance(0)
  396. end
  397.  
  398. on resetPeeKdisplay
  399.   global oPuppeteer, oStoryteller
  400.   set pkScanIcon to 41
  401.   set pkBarIcon to 42
  402.   set pkAmberIcon to 43
  403.   set camSprite to 44
  404.   set peekVideo to getProp(the lsForegroundData of oPuppeteer, #PkVideoNormal)
  405.   set the castNum of sprite camSprite to getProp(peekVideo, #PkNone)
  406.   set scanStatus to getState(oStoryteller, #PKscanStatus)
  407.   if (scanStatus <> #Offline) and (scanStatus <> #CantAttach) then
  408.     set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 3)
  409.   else
  410.     set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #scanIcon), 2)
  411.   end if
  412.   if getState(oStoryteller, #BarOnline) = 1 then
  413.     set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 3)
  414.   else
  415.     set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #barIcon), 2)
  416.   end if
  417.   if getState(oStoryteller, #AMBERisOnline) = 1 then
  418.     set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 3)
  419.   else
  420.     set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiframes of oPuppeteer, #amberIcon), 2)
  421.   end if
  422.   updateStage()
  423. end
  424.  
  425. on buildDefaultPlaylist
  426.   global gPeekPlayList
  427.   set currentLoc to string(getState(oStoryteller, #currentLocation))
  428.   set whichRoom to getLocationPointer(oPuppeteer, currentLoc, #sublist)
  429.   set gPeekPlayList to [#PkFadeIn, #PkFadeOut]
  430.   if whichRoom <> #office then
  431.     addAt(gPeekPlayList, 2, #PkOffice)
  432.   end if
  433.   if whichRoom <> #Marg then
  434.     addAt(gPeekPlayList, 2, #Pk40s)
  435.   end if
  436.   if whichRoom <> #MBR then
  437.     addAt(gPeekPlayList, 2, #PkMBR)
  438.   end if
  439.   if whichRoom <> #kitchen then
  440.     addAt(gPeekPlayList, 2, #PkKitchen)
  441.   end if
  442.   if whichRoom <> #diningRm then
  443.     addAt(gPeekPlayList, 2, #PkDiningRm)
  444.   end if
  445.   if whichRoom <> #livingRm then
  446.     addAt(gPeekPlayList, 2, #PkLivingRm)
  447.   end if
  448.   if whichRoom <> #Study then
  449.     addAt(gPeekPlayList, 2, #PkStudy)
  450.   end if
  451. end
  452.